export function formatKandW(num) {
    if (num >= 1000 && num<10000){
       num = (num/1000).toFixed(1) +'K';
    }else if(num>=10000){
       num = (num/10000).toFixed(1) +'W';
    }
    return num
}

export function formatDateCh(newDay) {
    newDay = newDay*1000;
    var dateNow = new Date();
    dateNow = $moment(dateNow).format("YYYY-MM-DD");
    var yesterday = $moment(newDay).format("YYYY-MM-DD");
    var strDayName = "";
    var lessDay = $moment(dateNow).diff($moment(yesterday), 'days');
    switch (lessDay) {
        case 0: strDayName = "今天" + $moment(newDay).format("HH:mm"); break;
        case 1: strDayName = "昨天" + $moment(newDay).format("HH:mm"); break;
        case 2: strDayName = "前天" + $moment(newDay).format("HH:mm"); break;
        default:
            strDayName = $moment(newDay).format("YYYY年MM月DD日 HH:mm");
            break;
    }
    return strDayName;
}

